﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Tasks;
using System.Windows.Media.Imaging;

namespace Family.View
{
    public partial class PanoramaPage2 : PhoneApplicationPage
    {
        private readonly PhotoChooserTask _photoTask;
        private BitmapImage Food_Image;
        PhotoChooserTask photoChooserTask;

        public PanoramaPage2()
        {
            InitializeComponent();
            photoChooserTask = new PhotoChooserTask();
            photoChooserTask.Completed += new EventHandler<PhotoResult>(photoChooserTask_Completed);
        }
        private void photoChooserTask_Completed(object sender, PhotoResult e)
        {
            BitmapImage bitmap = new BitmapImage();
            bitmap.SetSource(e.ChosenPhoto);
            image1.Source = (bitmap);
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            photoChooserTask.Show();
        }
    }
}